package com.tongcao.cn.helper;

import com.tongcao.cn.util.PropertiesUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.Properties;

/**
 * @Author:tongcao
 * @Date:2018/8/25 12:21
 * Description:
 */
@Component
public class CommonHelper {

    private Properties errorProps;

    @Value("${tongcao.appKey}")
    private String appKey;

    @Value("${tongcao.appSecret}")
    private String appSecret;


    @PostConstruct
    private void initErrorProps() {
//        errorProps = PropertiesUtils.getProperty("error.properties");
        errorProps = new Properties();
    }

    /**
     * 获取错误代码
     *
     * @param key
     * @return
     */
    public String getErrorProps(String key) {
        return errorProps.getProperty(key);
    }


}
